﻿//对话框  
var infowin, colse, title, content;
var width = 250, height = 120, offset = 30;
var beforePoint;
var beforeMapPoint;

infowin = document.getElementById("infowin");
colse = document.getElementById("close");
title = document.getElementById("title");
content = document.getElementById("content");

function showinfowindow(x, y, graphic) {
    infowin.style.left = (x - width / 2) + "px";
    infowin.style.top = (y - height - offset) + "px";
    //infowin.style.left = (window.screen.width - width-22) + "px";
    //infowin.style.top = (window.screen.height - height-125) + "px";
    infowin.style.position = "absolute";
    infowin.style.right = "10px";
    infowin.style.bottom = "10px";
    infowin.style.width = width + "px";
    infowin.style.height = height + "px";
    infowin.style.display = "block";
    var strtitle = "降水报警";
    var strcontent = "站点:" + graphic.attributes.id + "    站名：" + graphic.attributes.Name + "<br></br>" + "风速:" +graphic.attributes.WindSpeed + "    风向：" + graphic.attributes.WindDirection + "<br></br>" + "降水:" + "100mm" + "    温度：" + "30℃" + "<br></br>" + "气压:" + "1000pa" + "    湿度：" + "56%";
    title.innerHTML = strtitle;
    content.innerHTML = strcontent;
    isWindowShow = 1;
}

var isWindowShow = 0;
var closeInfoWin = function (evt) {
    infowin = document.getElementById("infowin");
    infowin.style.display = "none";
    isWindowShow = 0;
};